package com.example.drug.service.impl;

import com.example.drug.domain.Inventory;
import com.example.drug.mapper.InventoryMapper;
import com.example.drug.service.InventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 库存服务实现类
 *
 * @author [你的名字]
 * @date [具体日期]
 */
@Service
public class InventoryServiceImpl implements InventoryService {

    @Autowired
    private InventoryMapper inventoryMapper;

    @Override
    public List<Inventory> selectAllInventory() {
        return inventoryMapper.selectAllInventory();
    }

    @Override
    public List<Inventory> selectInventoryByParam(Long drugId) {
        return inventoryMapper.selectInventoryByParam(drugId);
    }

    @Override
    public Inventory selectInventoryById(Long id) {
        return inventoryMapper.selectInventoryById(id);
    }

    @Override
    public int insertInventory(Inventory inventory) {
        return inventoryMapper.insertInventory(inventory);
    }

    @Override
    public int updateInventory(Inventory inventory) {
        return inventoryMapper.updateInventory(inventory);
    }

    @Override
    public int deleteInventoryById(Long id) {
        return inventoryMapper.deleteInventoryById(id);
    }
}